package com.example.administrator.baseadapter.recyclerview.image;

import android.content.Context;
import android.support.annotation.DrawableRes;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;

/**
 * 图片加载帮助类
 * Created by baron
 * Date : 2016/6/1 0001 10:54
 * Email: 5267621@qq.com
 */
public class ImageLoaderHelper {

    public static void display(Context context, String url, ImageView imageView, @DrawableRes int shouldDrawable) {
        Glide.with(context)
                .load(url)
                .error(shouldDrawable)
                .placeholder(shouldDrawable)
                .diskCacheStrategy(DiskCacheStrategy.ALL)//设置全尺寸缓存
                .into(imageView);
    }
}
